/*
 * @FilePath: /cpp_study/ch04/mixtypes.cpp
 * @Description: some type combinations
 * @Author: dengrunting
 * @Date: 2021-12-21 14:54:29
 * @LastEditTime: 2021-12-21 15:44:07
 */
#include<iostream>

struct antarctica_years_end{
    int year;
};

int main(){

    antarctica_years_end s01, s02, s03;
    s01.year = 1998;
    s03.year = 2222;
    antarctica_years_end * pa = &s02;
    pa->year = 1999;
    antarctica_years_end trio[3];
    trio[0].year = 2003;
    std::cout <<  trio->year << std::endl;
    const antarctica_years_end * arp[3] = {&s01, &s02, &s03}; // 指针数组, arp指向第一个元素的指针,此时地一个元素保存的是 s01的地址
    std::cout << arp[1]->year << std::endl;
    const antarctica_years_end **ppa = arp; // 指向结构体指针的指针, 此时ppa = arp,都是指向指针的指针
    // const antarctica_years_end **ppb = arp;
    auto ppb = arp;
    std::cout << *ppa << "  " << *arp << "  " << arp[0] << arp[1] << arp[2] << "  " << arp << ppa << std::endl;
    std::cout << (*ppa)->year << std::endl;
    std::cout << (*(ppb+1))->year << std::endl;
    return 0;
}
